UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVCzPl6NLH8wL9ea9Xd0Tyjv6h6xhyLE4X0MH2g5BWQ='
WHERE
key_id = 'e3e7693ea5479b640630020a1e9c6899edaf9d3e077c7f1d51d35cba1322103f'
AND (
token = 'cVCzPl6NLH8wL9ea9Xd0Tyjv6h6xhyLE4X0MH2g5BWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)