UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RV6egMTQmUSgudoRkErgBZFVjot7/7bHkBnxPX/vNb8=' 
WHERE 
  key_id = '0c4f02ed4bea90e7ccd5a64122b53b7f9ed33ad069d8e0c5535fc234acf3d4d0' 
  AND (
    token = 'RV6egMTQmUSgudoRkErgBZFVjot7/7bHkBnxPX/vNb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032