UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bSEEjcv8MxyHpxj2VxgmzeG+0Jc6A79+2NMRrP9ctu4='
WHERE
key_id = 'db1cae587efe2cceabda630dabf8ed3a122cf272f829efea63089fda5d46468b'
AND (
token = 'bSEEjcv8MxyHpxj2VxgmzeG+0Jc6A79+2NMRrP9ctu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)