UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2MJ0nv/uWROXM6YdT/9jqqBAuv0N5rw+nZxx7zInddQ='
WHERE
key_id = 'f6fa7a6a1ee876e7baeec0a7657e5f24dad3d5859b6ea5438bcec56f03438a47'
AND (
token = '2MJ0nv/uWROXM6YdT/9jqqBAuv0N5rw+nZxx7zInddQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)