UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MZ7qJMiFqZH7ZFBJP8ugTMwEsbtys+cpNgeoGuEarMA=' 
WHERE 
  key_id = '8388e9195907d0a598207acd087d382ecc6d8a035f61f5b09c9a99ac063bee1e' 
  AND (
    token = 'MZ7qJMiFqZH7ZFBJP8ugTMwEsbtys+cpNgeoGuEarMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032