UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YTJ/5OC0tijEOqdxPNgMXJTMn4XUC5gj+CTJ0ZvC+8U='
WHERE
key_id = '4df9de675ff70ca08e7c3e51253b19c19d01009c759b348fbb2dd9a8a7124b61'
AND (
token = 'YTJ/5OC0tijEOqdxPNgMXJTMn4XUC5gj+CTJ0ZvC+8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)