UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ky/xPJTMkrOSXweHvPQVsoCZJsiSEUmmZgdT1nS/9g='
WHERE
key_id = '1c46a85996221e824d1bec6ac35aab2c002861a909ac7bc01b47d7cf64aee716'
AND (
token = '4ky/xPJTMkrOSXweHvPQVsoCZJsiSEUmmZgdT1nS/9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)