UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VTWz69IpxiZjBH7qI+Lj5c27GxGm02R4Rz/lFE+OPfA='
WHERE
key_id = '1710868d91795a43a32ec923a849700d1e14df1c6683cbee1177d6de605f269c'
AND (
token = 'VTWz69IpxiZjBH7qI+Lj5c27GxGm02R4Rz/lFE+OPfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)