UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WcRGBJAArnH7s2amcsUJqT/NHitVEhDRdHOgEMcgzBM='
WHERE
key_id = '72e224f78039cccdc65b2d761af0dd990aac0b43e135eeeb3e1e91c1c37c0594'
AND (
token = 'WcRGBJAArnH7s2amcsUJqT/NHitVEhDRdHOgEMcgzBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)