UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nQjAT9c7mxfy0u804bwVPtEgLl2KRCf4FGfw+5y0XUE=' 
WHERE 
  key_id = '1f9e695759d5fd490a6bbec01c97bdc15987c089d0b8390c5f5b0fad4178f9b1' 
  AND (
    token = 'nQjAT9c7mxfy0u804bwVPtEgLl2KRCf4FGfw+5y0XUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034