UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OKPtcBlSiEmJLnSqXLSZfFYnMheoeivbyYPYkhIAyqI='
WHERE
key_id = '80e6ada0a4b3946515655fa981ebc45574927dd502eea4023efb3e4dff28671f'
AND (
token = 'OKPtcBlSiEmJLnSqXLSZfFYnMheoeivbyYPYkhIAyqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)