UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WfPPdjpMj8nRfvAK/EN1lmST1AhNyrKgcbyzVtB9NDA='
WHERE
key_id = '9c2b6ab345ecaaf0643d79a17c94fa0473090565388bbfcd17c0e0987fdb2a44'
AND (
token = 'WfPPdjpMj8nRfvAK/EN1lmST1AhNyrKgcbyzVtB9NDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)