UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WuEHhiYEZ6rjuEi3jo6KzxSm/jggqeC+/B74R+h0MOY='
WHERE
key_id = 'e6054b8f8fe0980c3eef6df38d70f60c2d84c9e029efd33c9a94dbcb3db570e3'
AND (
token = 'WuEHhiYEZ6rjuEi3jo6KzxSm/jggqeC+/B74R+h0MOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)