UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HFFmF3TzBNMamqazAnMrs/eqlOA80+xcgBppw9uPIbI='
WHERE
key_id = 'ea98171ff072093a2b9022910819fa1fd61925d720c3d4074fc0bbd04296a0a0'
AND (
token = 'HFFmF3TzBNMamqazAnMrs/eqlOA80+xcgBppw9uPIbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)