UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/4rJuomOWxHDRb94DwhQ0lanJ3hjouWwVEP5WsR8oYg='
WHERE
key_id = 'bdbbe3c9487451c7550588f3a3698f758c05ff9e4b1aa18c39b3f68157b8d6ee'
AND (
token = '/4rJuomOWxHDRb94DwhQ0lanJ3hjouWwVEP5WsR8oYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)