UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LU/sndrFbs28nLDo5ixkTwfcP44pBSurqNWGdxPyCVU='
WHERE
key_id = '59fc61b2e850fc389835a9f141de35fe8de8140db5a02e744b1cf2e077afd204'
AND (
token = 'LU/sndrFbs28nLDo5ixkTwfcP44pBSurqNWGdxPyCVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)