UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KjOFiHLDALopmwXwfL80JDJ+fnwd3psvDVuq3I46LU8=' 
WHERE 
  key_id = 'd93988b04954ec8332075cfa4c61add04486120b8cd3ff44313751b3c1ee560e' 
  AND (
    token = 'KjOFiHLDALopmwXwfL80JDJ+fnwd3psvDVuq3I46LU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039