UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2sa9L5AI/AxLfE1BD/+Ke8UvNfT6I471OudYEh4G0rk='
WHERE
key_id = '5f8a486a02bbab02dc4c5208b93885018949afb8f7b2be942e36ad9b7b25f792'
AND (
token = '2sa9L5AI/AxLfE1BD/+Ke8UvNfT6I471OudYEh4G0rk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)