UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n909t9CWZkoKJgc9zZDZR+icqwLuUWaBJ6KtZlPiktM='
WHERE
key_id = '62379210ea078586aad2b1a596388dedb1d83eee76a4d0ae61df710283ef41dd'
AND (
token = 'n909t9CWZkoKJgc9zZDZR+icqwLuUWaBJ6KtZlPiktM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)