UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UeJKkYEt9/NkbVVa/QuUJdv76Peo8Ek9pYlwaZwNKDg='
WHERE
key_id = '16f8d33960819a4384650b109f8aa1e91f29b7b95486786b9f72292be0fdc5f3'
AND (
token = 'UeJKkYEt9/NkbVVa/QuUJdv76Peo8Ek9pYlwaZwNKDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)