UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sB0poBKxpkaLHRPjx9YnqiftjDXjpStvpxRYoBxrqeA='
WHERE
key_id = '26c5d4cfc383025abb71f1741e0304327d7d0dc30820ecbe79acd4032416bddc'
AND (
token = 'sB0poBKxpkaLHRPjx9YnqiftjDXjpStvpxRYoBxrqeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)