UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e0gUCnU3Q5TtmqIS8IgYlixj5gXG8yBeFa0IUisE04g='
WHERE
key_id = '203e471a35c06896955e3c0558d74e430bec214b668a7821faf4ba0b5006ebfb'
AND (
token = 'e0gUCnU3Q5TtmqIS8IgYlixj5gXG8yBeFa0IUisE04g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)