UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zZkLw/b8/9Yx4gWfzfNe/deLFvPC8KBRVysF0R/QswU='
WHERE
key_id = '5d18c36aa27d7ba1dcf7d8327b8fce80914a7d76323e35676b48683af3f8e7dc'
AND (
token = 'zZkLw/b8/9Yx4gWfzfNe/deLFvPC8KBRVysF0R/QswU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)