UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wM61O+EP+dy5FNZZzwoklPtAcWCFanK81s5JRL5VpYI='
WHERE
key_id = '3bff42e533f1fbc5c9167e18b1dfe4b94720ec4de766adeabc4c91813e8ff55a'
AND (
token = 'wM61O+EP+dy5FNZZzwoklPtAcWCFanK81s5JRL5VpYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)