UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/7Cz93S6gGhPrlv1Adl+nDwcUjRweOUIe2lXiODyfj8='
WHERE
key_id = 'e67335695cc25a59389a53351355362769652ff390a76415baaf69e961663f17'
AND (
token = '/7Cz93S6gGhPrlv1Adl+nDwcUjRweOUIe2lXiODyfj8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)