UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'syglrWlzFRaV4rcDMyKBgSYuXDooRpbJ6XV48ymfuZQ='
WHERE
key_id = '9a87e2adc6a7a118eaffc0fe23ccb26052c868868ab19e1bc7891ea531c12ca9'
AND (
token = 'syglrWlzFRaV4rcDMyKBgSYuXDooRpbJ6XV48ymfuZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)