UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EVVkNXCVVog/dQCksqC1jfk4oMWjwMDHqjIb1uw0Hhw='
WHERE
key_id = 'ddf8800dceec3dfa3afb01528eee17af1a845e0e046666249a93614ff1b00b17'
AND (
token = 'EVVkNXCVVog/dQCksqC1jfk4oMWjwMDHqjIb1uw0Hhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)