UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+tUUMHRJxlvnurl6D08yIFh+a3k8Fo6a/N1sz2bshjI='
WHERE
key_id = 'fc9729b231c88c553962880b6b25e6f85e0ea6eb1c765308264e7eb7853eed18'
AND (
token = '+tUUMHRJxlvnurl6D08yIFh+a3k8Fo6a/N1sz2bshjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)