UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JVBwDTWCuS4IyJVxnFpmzsP9sa5/BE2GHyQdgYmGmnI='
WHERE
key_id = 'e1fb3d69e15834b58ba2a9dc3c10ba643f8d2df2dc3e89bd5082c6b7df53814e'
AND (
token = 'JVBwDTWCuS4IyJVxnFpmzsP9sa5/BE2GHyQdgYmGmnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)