UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DkcRY+glcRrt4ExFPAd9Sw0hghF0icrw9ztEC7Le348='
WHERE
key_id = '5932b991d8876ecd75c1a709f0119971dfdbf747e7e04cdf92c643ef1834c563'
AND (
token = 'DkcRY+glcRrt4ExFPAd9Sw0hghF0icrw9ztEC7Le348='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)