UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cr/f+mR1f+IVBHXW0AKxm62okJdxMbrcAf88fVnIp6I='
WHERE
key_id = '36b0e0d631322e12b41665e7fa9d90b6cca77ee6511083436bc55d0a1dff015d'
AND (
token = 'cr/f+mR1f+IVBHXW0AKxm62okJdxMbrcAf88fVnIp6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)