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