UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oaqiA391GwwpNEaDUo9Cro6+EONBWKupyCz891Pl5ng='
WHERE
key_id = '4c95cde4adef42ac52415149533f069facbaa06f8b6d9617fc5ecccaaa08c7ab'
AND (
token = 'oaqiA391GwwpNEaDUo9Cro6+EONBWKupyCz891Pl5ng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)