UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vUrKe6dF6mMjft9mZo53jN/bx1DGpRvj0XaVYAc0ljw='
WHERE
key_id = '9cb7f17a255cd97b9a7329e508d3526d62f53927ca926de51c7314c835cb2cba'
AND (
token = 'vUrKe6dF6mMjft9mZo53jN/bx1DGpRvj0XaVYAc0ljw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)