UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/POHOGwllu3LMaCLjYJon36ictek/p+LFylcaUBEYlM='
WHERE
key_id = '1f040b48262920c4857cf512610b6f9ce3e36eca6b88ec0e6227898455e76ff2'
AND (
token = '/POHOGwllu3LMaCLjYJon36ictek/p+LFylcaUBEYlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)