UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o2i2Jc6OxUJVDtI25sOmxt7ZrwFKN94smuA4Ux4zVng='
WHERE
key_id = 'ab0eccb787d11cb7031ed664b0684059cc9dfe264275eb961ebe643b7343ba7c'
AND (
token = 'o2i2Jc6OxUJVDtI25sOmxt7ZrwFKN94smuA4Ux4zVng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)